package utils

type Response map[string]interface{}

func DealResponse(params Response) *Response {
	// 可变入参示例
	code := 1
	if val, ok := params["code"]; ok {
		code = val.(int)
	}
	msg := ""
	if val, ok := params["msg"]; ok {
		msg = val.(string)
	}
	var data interface{}
	if val, ok := params["data"]; ok {
		data = val
	}

	return &Response{
		"code": code,
		"msg":  msg,
		"data": data,
	}
}
